.systemhead.remote
  =link_to url_for(:action => :closesys, :biz_process_id => biz_process.id, :id => system.id), :remote => true, :"data-type" => "html" do
    %img.tree{:src => "/images/collapse.gif"}>
  =link_to url_for(:action => :closesys, :biz_process_id => biz_process.id, :id => system.id), :remote => true, :"data-type" => "html" do
    %span{:title => system.slug}><
      =system.title
  -@state = system.state_by_process(biz_process)
  %span{:class => @state[:state]}
    =@state[:state].to_s.capitalize
  %span
    (
    %span{:class => @state[:state]}
      =@state[:bad]
    ="/"
    =@state[:count]
    )
  %span.owner
    =system.owner.display_name
-scs = system.system_controls.where(:cycle_id => @cycle.id)
-if !scs.empty?
  -system.system_controls_by_process(biz_process).each do |sc|
    -next if sc.cycle != @cycle
    -control = sc.control
    .tree.control
      %span.dashtitle.control{:title => control.slug}><
        =control.title
      %span{:class => sc.state}
        =sc.state.to_s.capitalize
      %div
        -if sc.ticket
          Ticket:
          =sc.ticket
-else
  %div.error
    No Controls Attached

